import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { lotmonthlycardlotVO, lotmonthlycardlotForm, lotmonthlycardlotQuery } from '@/api/access/parking-lot/parking-lot-monthly-card-lot/types';

/**
 * 查询停车场-月卡停车场关联列表
 * @param query
 * @returns {*}
 */

export const listlotmonthlycardlot = (query?: lotmonthlycardlotQuery): AxiosPromise<lotmonthlycardlotVO[]> => {
  return request({
    url: '/parkinglot/lotMonthlyCardLot/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场-月卡停车场关联详细
 * @param parkingLotMonthlyCardLotId
 */
export const getlotmonthlycardlot = (parkingLotMonthlyCardLotId: string | number): AxiosPromise<lotmonthlycardlotVO> => {
  return request({
    url: '/parkinglot/lotMonthlyCardLot/' + parkingLotMonthlyCardLotId,
    method: 'get'
  });
};

/**
 * 新增停车场-月卡停车场关联
 * @param data
 */
export const addlotmonthlycardlot = (data: lotmonthlycardlotForm) => {
  return request({
    url: '/parkinglot/lotMonthlyCardLot',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场-月卡停车场关联
 * @param data
 */
export const updatelotmonthlycardlot = (data: lotmonthlycardlotForm) => {
  return request({
    url: '/parkinglot/lotMonthlyCardLot',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场-月卡停车场关联
 * @param parkingLotMonthlyCardLotId
 */
export const dellotmonthlycardlot = (parkingLotMonthlyCardLotId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotMonthlyCardLot/' + parkingLotMonthlyCardLotId,
    method: 'delete'
  });
};
